Skip to content

layer: revert to original form_cdi interface#15

Merged
sameo merged 1 commit intorivosinc:mainfrom
dgreid:topic/cert_lifetime
Apr 21, 2025
Merged

layer: revert to original form_cdi interface#15
sameo merged 1 commit intorivosinc:mainfrom
dgreid:topic/cert_lifetime

Conversation

@dgreid
Copy link
Contributor

@dgreid dgreid commented Apr 16, 2025

After integrating with salus, it turns out having the second slice in simler. The lifetime complexities that motivated the original charge are resolved by attaching the lifetime of the output slice to the input it is based on instead of Self.

@dgreid dgreid requested review from Copilot and sameo April 16, 2025 20:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reverts the form_cdi interface to its original form to simplify lifetime complexities based on the output slice’s lifetime. Key changes include updating the function signatures in Certificate methods to add an explicit buffer lifetime ('buf) with corresponding return types and adjusting the caller code in layer.rs accordingly.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/x509/certificate.rs Updated Certificate functions to include a 'buf lifetime, change the certificate_buf parameter, and return a slice reference instead of unit.
src/layer.rs Adjusted invocations of Certificate functions to align with the new signature changes.
Comments suppressed due to low confidence (1)

src/x509/certificate.rs:209

  • [nitpick] The 'certificate_buf' parameter now serves as an input/output buffer; consider renaming it (e.g., to 'buf' or 'cert_der_buf') to more clearly reflect its dual role.
certificate_buf: &'buf mut [u8],

After integrating with salus, it turns out having the second slice in
simpler. The lifetime complexities that motivated the original charge
are resolved by attaching the lifetime of the output slice to the
input it is based on instead of `Self`.

Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
@dgreid dgreid force-pushed the topic/cert_lifetime branch from 55ccabe to d6edb43 Compare April 16, 2025 20:48
@dgreid dgreid self-assigned this Apr 18, 2025
@sameo sameo merged commit 67c3a1c into rivosinc:main Apr 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants